using System.Net.Sockets;

namespace SmartBoard.Core.Networking
{
    /// <summary>
    /// Client socket connection implementation.
    /// </summary>
    internal class ClientSocketConnection : BaseSocketConnection, IClientSocketConnection
    {
        #region Constructor

        internal ClientSocketConnection(BaseSocketConnectionHost host, BaseSocketConnectionCreator creator, Socket socket)
            : base(host, creator, socket)
        {

        }

        #endregion

        #region ISocketConnection Members

        public override IClientSocketConnection AsClientConnection()
        {
            return this;
        }

        public override IServerSocketConnection AsServerConnection()
        {
            return null;
        }

        #endregion

        #region IClientSocketConnection Members

        public ProxyInfo ProxyInfo
        {
          
            get
            {
                return ((SocketConnector)Creator).ProxyInfo;
            }

        }

        public void BeginReconnect()
        {
            BaseHost.BeginReconnect(this);
        }
        #endregion
    }
}